-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change OpLogFilter::agent_id
to be optional
#826
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #826 +/- ##
==========================================
+ Coverage 77.01% 77.55% +0.53%
==========================================
Files 31 32 +1
Lines 25569 26061 +492
==========================================
+ Hits 19692 20211 +519
+ Misses 5877 5850 -27 ☔ View full report in Codecov by Sentry. |
880ab3d
to
3c66f2e
Compare
3c66f2e
to
d173f83
Compare
OpLogFilter
development directionOpLogFilter::agent_id
to be optional
6b211c0
to
be77ab4
Compare
be77ab4
to
fe5bc59
Compare
fe5bc59
to
4bef708
Compare
src/ingest/generation.rs
Outdated
let mut last_reset_day = self | ||
.last_reset_date | ||
.lock() | ||
.expect("last_reset_date should be exist."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two questions regarding this line:
- Could you run grammar check for the expect message please?
- Could you help me understand the choice of
expect
here please ? To me it seems like we need to use something likepanic!
according to our guideline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the source code from Mutex
to RwLock
as below.
Therefore, there seems to be no need to discuss expect
and panic!
.
pub struct SequenceGenerator {
counter: AtomicUsize,
last_reset_date: RwLock<u32>,
}
pub(crate) async fn generate_sequence_number(&self) -> usize {
let current_date_time = SequenceGenerator::get_current_date_time();
{
let last_reset_day = self.last_reset_date.read().await;
if *last_reset_day == current_date_time {
return self.counter.fetch_add(1, Ordering::Relaxed);
}
}
{
let mut last_reset_day = self.last_reset_date.write().await;
self.counter.store(1, Ordering::Release);
*last_reset_day = current_date_time;
}
self.counter.fetch_add(1, Ordering::Relaxed)
}
e67329d
to
97ce434
Compare
ff0dcae
to
bf40057
Compare
bf40057
to
05d610b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the version in Cargo.toml file should be updated to have suffix '-alpha.2'.
05d610b
to
d868535
Compare
It's done. |
d868535
to
931ac8c
Compare
@sophie-cluml |
@henry0715-dev, I believe there are still a few areas that need to be addressed in the current PR, and with the demand for the upcoming release, I'm afraid it may not be feasible to include this PR in the 0.23.0 release. I apologize for any inconvenience, and I appreciate your understanding. |
@sophie-cluml |
As a reply to #826 (comment), I would appreciate if you could update the version to 0.24.0-alpha.1 for this PR and make consecutive changes. |
931ac8c
to
cbbde80
Compare
It's done. |
cbbde80
to
7370c47
Compare
7370c47
to
c2a2bf5
Compare
c2a2bf5
to
4a1cbf5
Compare
I would like to merge this PR after @henry0715-dev resolves a conflict in the CHANGELOG. As far as I know, David and Kone are interested in this PR, so I'd like to ask @kimhanbeom and @sehkone if there are any remaining concerns, so that I need to put hold on merging this PR. |
I noticed the To illustrate, in the current format:
In the new format, this problem doesn’t arise because the fixed-size timestamp ensures keys like:
Removing |
4a1cbf5
to
cfb4bde
Compare
I applied the content to the source code. |
src/storage.rs
Outdated
|
||
pub fn mid_key(mut self, key: usize) -> Self { | ||
let mid_key = key.to_be_bytes(); | ||
self.pre_key.reserve(mid_key.len() + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need + 1
here, because we are not padding the key with b'0'
anymore, and the same for the other relevant places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally
I modified the following in the lower_closed_bound_start_key
, upper_open_bound_start_key
, and upper_closed_bound_start_key
functions.
as-is
self.pre_key.reserve(TIMESTAMP_SIZE+1);
to-be
self.pre_key.reserve(TIMESTAMP_SIZE);
Close #724 The RocksDB keys in the `oplog` are currently in the form agent_id-0-timestamp. This change modifies the keys to the form timestamp-sequence.
cfb4bde
to
19d4409
Compare
Close #724
The RocksDB keys in the
oplog
are currently in the form agent_id-0-timestamp. This change modifies the keys to the form timestamp-sequence.